export default {
    state: {
        // 控制菜单栏状态
        isCollapse: false,
        // 面包屑数据数组
        tabsList: [
        ],
    },
    mutations: {
        // 更新侧边栏状态
        collapseChange(state) {
            state.isCollapse = !state.isCollapse
        },
        // 头部面包屑更新
        menuChange(state, val) {
            //val：菜单对象数据
            // 不是首页
            const index = state.tabsList.findIndex(item => item.name === val.name)
            if (index === -1) {
                state.tabsList.push(val)
            }
        },
        closeTag(state, val) {
            // 关闭
            const index = state.tabsList.findIndex(item => item.name === val.name)
            state.tabsList.splice(index, 1)
        }
    }
}
